package(default_applicable_licenses = ["//:license"])

REPO_ROOT = package_relative_label(":BUILD.bazel").workspace_root

INCLUDE_PREFIX = "/".join((
    REPO_ROOT if REPO_ROOT else ".",
    "src",
))

[
    cc_test(
        name = target,
        srcs = [
            "%s.c" % target,
            "@aravis//src:aravis_private_headers",
        ],
        copts = ["-I%s" % INCLUDE_PREFIX],
        data = [data] if data else [],
        defines = ["GENICAM_FILENAME=\\\"$(rootpath %s)\\\"" % data] if data else [],
        deps = ["@aravis"],
    )
    for target, data in [
        ("evaluator", None),
        ("buffer", None),
        ("misc", None),
        ("dom", "data/genicam.xml"),
        ("genicam", "data/genicam.xml"),
        ("fake", "//src:fake_camera_config"),
        ("fakegv", "//src:fake_camera_config"),
    ]
]
